<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-user-edit" th:object="${user}">
        <input id="id" name="id" th:field="*{id}" type="hidden">

        <div class="form-group">
            <label class="col-sm-3 control-label">手机号：</label>
            <div class="col-sm-8">
                <input id="phone" name="phone" th:field="*{phone}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">昵称：</label>
            <div class="col-sm-8">
                <input id="nickName" name="nickName" th:field="*{nickName}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">真实姓名：</label>
            <div class="col-sm-8">
                <input id="realName" name="realName" th:field="*{realName}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">单雷概率：</label>
            <div class="col-sm-8">
                <input id="leiPercent" name="leiPercent" th:field="*{leiPercent}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">多雷1雷概率：</label>
            <div class="col-sm-8">
                <input id="leiPercent" name="leiPercent" th:field="*{oneLeiPercent}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">多雷2雷概率：</label>
            <div class="col-sm-8">
                <input id="twoLeiPercent" name="twoLeiPercent" th:field="*{twoLeiPercent}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">多雷3雷概率：</label>
            <div class="col-sm-8">
                <input id="threeLeiPercent" name="threeLeiPercent" th:field="*{threeLeiPercent}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label" id="imgLabel" >用户头像</label>
            <div class="col-sm-8">
                <div class="uploder-container" imgType="user" fileNum="1">
                    <div  class="cxuploder">
                        <input id="headImg" name="headImg" type="hidden" th:field="*{headImg}"  />
                        <div class="queueList">
                            <div class="placeholder">
                                <div class="filePicker"></div>
                                <p>将照片拖到这里</p>
                            </div>
                        </div>
                        <div class="statusBar" style="display:none;">
                            <div class="btns">
                                <!--<div  class="jxfilePicker"></div>-->
                            </div>
                            <div class="info"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">用户类型：</label>
            <div class="col-sm-8">
                <select id="userType" name="userType" class="form-control m-b"
                        th:with="type=${@dict.getType('user_type')}">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
                            th:field="*{userType}"></option>
                </select>
            </div>
        </div>

    </form>
</div>
<div th:include="include :: footer"></div>
<div th:include="tool/upload/webuploader :: webuploader"></div>
<script th:src="@{/ajax/libs/select/select2.js}"></script>
<!--富文本编辑器-->
<script src="../../../static/tinymce/tinymce.min.js" th:src="@{/tinymce/tinymce.min.js}"></script>
<script src="../../../static/tinymce/tinymce.common.js" th:src="@{/tinymce/tinymce.common.js}"></script>
<script type="text/javascript">
    var prefix = ctx + "module/user"
    $("#form-user-edit").validate({
        rules: {
            xxxx: {
                required: true,
            },
        }
    });

    function submitHandler() {
        if ($.validate.form()) {
            //图片
            var imgList = getImgList(0);
            $("#headImg").val(imgList);
            $.operate.save(prefix + "/edit", $('#form-user-edit').serialize());
        }
    }
</script>
</body>
</html>
